<?php
include("../config.php");

$result=mysql_query("SELECT avatar FROM `user` WHERE id='$_GET[id]'") or die(mysql_error()); 
$row=mysql_fetch_object($result); 
Header( "Content-type: image/png"); 
echo $row->avatar;

?>